<!-- 带分页的table -->
<script setup lang="ts">
import type { IPage, IPageTable } from '@/type/interfaces';
interface IProps {
    tableConfig: IPageTable
    page: IPage
}
const props = withDefaults(defineProps<IProps>(), {

})
const emit = defineEmits(['pageChange'])
const pageChange = (page: IPage) => {
    emit('pageChange', page)
}
</script>
<template>
    <div class="page-table-container">
        <data-table :table-obj="tableConfig.tableObj" :table-prop="tableConfig.tableProp">
            <template #rowAction="{ index, row }">
                <slot name="rowAction" :index="index" :row="row"></slot>
            </template>
        </data-table>
        <div class="pt-10px pb-10px grid place-items-end">
            <pagination :page="page" @change="pageChange" :small="true"/>
        </div>
    </div>
</template>